<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>先出犄角后出头</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="android">
<meta property="og:type" content="website">
<meta property="og:title" content="先出犄角后出头">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="先出犄角后出头">
<meta property="og:description" content="android">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="先出犄角后出头">
<meta name="twitter:description" content="android">
  
    <link rel="alternate" href="/atom.xml" title="先出犄角后出头" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    
  
  <link rel="stylesheet" href="/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    
    <div id="header-inner" class="inner">
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">首页</a>
        
          <a class="main-nav-link" href="/archives">归档</a>
        
          <a class="main-nav-link" href="/about">关于</a>
        
      </nav>
      
    </div>
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">先出犄角后出头</a>
      </h1>
      
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-Android Studio混淆模板及常用第三方混淆" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/01/24/Android Studio混淆模板及常用第三方混淆/" class="article-date">
  <time datetime="2017-01-23T16:00:00.000Z" itemprop="datePublished">2017-01-24</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Android-Studio混淆模板及常用第三方混淆/">Android Studio混淆模板及常用第三方混淆</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/01/24/Android Studio混淆模板及常用第三方混淆/">Android Studio混淆模板及常用第三方混淆</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <!-- Table of Contents -->
        
        <p>首先要在build.gradle中开启混淆，也就是minifyEnabled true<br>build.gradle具体如下所示<br><figure class="highlight gradle"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">def</span> releaseTime() &#123;</div><div class="line">    <span class="keyword">return</span> <span class="keyword">new</span> Date().format(<span class="string">"yyyy.MM.dd"</span>, TimeZone.getTimeZone(<span class="string">"UTC-8"</span>))</div><div class="line">&#125;</div><div class="line"> </div><div class="line">android &#123;</div><div class="line">    .... </div><div class="line"> </div><div class="line">    buildTypes &#123;</div><div class="line">        release &#123;</div><div class="line">            <span class="comment">// 混淆</span></div><div class="line">            minifyEnabled <span class="keyword">true</span></div><div class="line">            <span class="comment">// Zipalign优化</span></div><div class="line">            zipAlignEnabled <span class="keyword">true</span></div><div class="line">            <span class="comment">// 移除无用的resource文件</span></div><div class="line">            shrinkResources <span class="keyword">true</span></div><div class="line">            <span class="comment">// 前一部分代表系统默认的android程序的混淆文件，该文件已经包含了基本的混淆声明，后一个文件是自己的定义混淆文件</span></div><div class="line">            proguardFiles getDefaultProguardFile(<span class="string">'proguard-android.txt'</span>), <span class="string">'proguard-rules.pro'</span></div><div class="line"> </div><div class="line">            applicationVariants.all &#123; variant -&gt;</div><div class="line">                variant.outputs.<span class="keyword">each</span> &#123; output -&gt;</div><div class="line">                    <span class="keyword">def</span> outputFile = output.outputFile</div><div class="line">                    <span class="keyword">if</span> (outputFile != <span class="keyword">null</span> &amp;&amp; outputFile.name.endsWith(<span class="string">'.apk'</span>)) &#123;</div><div class="line">                        <span class="comment">// 输出apk名称为appname-1.0-beta1-xxxx-xx-xx.apk</span></div><div class="line">                        <span class="keyword">def</span> fileName = <span class="string">"app-$&#123;defaultConfig.versionName&#125;-beta1-$&#123;releaseTime()&#125;.apk"</span></div><div class="line">                        output.outputFile = <span class="keyword">new</span> <span class="keyword">File</span>(outputFile.parent, fileName)</div><div class="line">                    &#125;</div><div class="line">                &#125;</div><div class="line">            &#125;</div><div class="line">        &#125;</div><div class="line">    &#125;</div><div class="line">    ....</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>上面注释中写到proguard-android.txt文件，这是系统默认的混淆文件，具体在../sdk/tools/proguard/目录下，其中包含了android最基本的混淆，一般不需要改动，我们需要配置的是项目中app下的proguard-rules.pro文件，在此提供一份混淆模板</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div><div class="line">127</div><div class="line">128</div><div class="line">129</div><div class="line">130</div><div class="line">131</div><div class="line">132</div><div class="line">133</div><div class="line">134</div><div class="line">135</div><div class="line">136</div><div class="line">137</div><div class="line">138</div><div class="line">139</div><div class="line">140</div><div class="line">141</div><div class="line">142</div><div class="line">143</div><div class="line">144</div><div class="line">145</div><div class="line">146</div><div class="line">147</div><div class="line">148</div><div class="line">149</div><div class="line">150</div><div class="line">151</div><div class="line">152</div><div class="line">153</div><div class="line">154</div><div class="line">155</div><div class="line">156</div><div class="line">157</div><div class="line">158</div><div class="line">159</div><div class="line">160</div><div class="line">161</div><div class="line">162</div><div class="line">163</div><div class="line">164</div><div class="line">165</div><div class="line">166</div><div class="line">167</div><div class="line">168</div><div class="line">169</div><div class="line">170</div><div class="line">171</div><div class="line">172</div><div class="line">173</div><div class="line">174</div><div class="line">175</div><div class="line">176</div><div class="line">177</div><div class="line">178</div><div class="line">179</div><div class="line">180</div><div class="line">181</div><div class="line">182</div><div class="line">183</div><div class="line">184</div><div class="line">185</div><div class="line">186</div><div class="line">187</div><div class="line">188</div><div class="line">189</div><div class="line">190</div><div class="line">191</div><div class="line">192</div><div class="line">193</div><div class="line">194</div><div class="line">195</div><div class="line">196</div><div class="line">197</div><div class="line">198</div><div class="line">199</div><div class="line">200</div><div class="line">201</div><div class="line">202</div><div class="line">203</div><div class="line">204</div><div class="line">205</div><div class="line">206</div><div class="line">207</div><div class="line">208</div><div class="line">209</div><div class="line">210</div><div class="line">211</div><div class="line">212</div><div class="line">213</div><div class="line">214</div><div class="line">215</div><div class="line">216</div><div class="line">217</div><div class="line">218</div><div class="line">219</div><div class="line">220</div><div class="line">221</div><div class="line">222</div><div class="line">223</div><div class="line">224</div><div class="line">225</div><div class="line">226</div><div class="line">227</div><div class="line">228</div><div class="line">229</div><div class="line">230</div><div class="line">231</div><div class="line">232</div><div class="line">233</div><div class="line">234</div><div class="line">235</div><div class="line">236</div><div class="line">237</div><div class="line">238</div><div class="line">239</div><div class="line">240</div><div class="line">241</div><div class="line">242</div><div class="line">243</div><div class="line">244</div><div class="line">245</div><div class="line">246</div><div class="line">247</div><div class="line">248</div><div class="line">249</div><div class="line">250</div><div class="line">251</div><div class="line">252</div><div class="line">253</div><div class="line">254</div><div class="line">255</div><div class="line">256</div><div class="line">257</div><div class="line">258</div><div class="line">259</div><div class="line">260</div><div class="line">261</div><div class="line">262</div><div class="line">263</div><div class="line">264</div><div class="line">265</div><div class="line">266</div><div class="line">267</div><div class="line">268</div><div class="line">269</div><div class="line">270</div><div class="line">271</div><div class="line">272</div><div class="line">273</div><div class="line">274</div><div class="line">275</div><div class="line">276</div><div class="line">277</div><div class="line">278</div><div class="line">279</div><div class="line">280</div><div class="line">281</div><div class="line">282</div><div class="line">283</div><div class="line">284</div><div class="line">285</div><div class="line">286</div><div class="line">287</div><div class="line">288</div><div class="line">289</div><div class="line">290</div><div class="line">291</div><div class="line">292</div><div class="line">293</div><div class="line">294</div><div class="line">295</div><div class="line">296</div><div class="line">297</div><div class="line">298</div><div class="line">299</div><div class="line">300</div><div class="line">301</div><div class="line">302</div><div class="line">303</div><div class="line">304</div><div class="line">305</div><div class="line">306</div><div class="line">307</div><div class="line">308</div><div class="line">309</div><div class="line">310</div><div class="line">311</div><div class="line">312</div><div class="line">313</div><div class="line">314</div><div class="line">315</div><div class="line">316</div><div class="line">317</div><div class="line">318</div><div class="line">319</div><div class="line">320</div><div class="line">321</div><div class="line">322</div><div class="line">323</div><div class="line">324</div><div class="line">325</div><div class="line">326</div><div class="line">327</div><div class="line">328</div><div class="line">329</div><div class="line">330</div><div class="line">331</div><div class="line">332</div><div class="line">333</div><div class="line">334</div><div class="line">335</div><div class="line">336</div><div class="line">337</div><div class="line">338</div><div class="line">339</div><div class="line">340</div><div class="line">341</div><div class="line">342</div><div class="line">343</div><div class="line">344</div><div class="line">345</div><div class="line">346</div><div class="line">347</div><div class="line">348</div><div class="line">349</div><div class="line">350</div><div class="line">351</div><div class="line">352</div><div class="line">353</div><div class="line">354</div><div class="line">355</div><div class="line">356</div><div class="line">357</div><div class="line">358</div><div class="line">359</div><div class="line">360</div><div class="line">361</div><div class="line">362</div><div class="line">363</div><div class="line">364</div><div class="line">365</div><div class="line">366</div><div class="line">367</div><div class="line">368</div><div class="line">369</div><div class="line">370</div><div class="line">371</div><div class="line">372</div><div class="line">373</div><div class="line">374</div><div class="line">375</div><div class="line">376</div><div class="line">377</div><div class="line">378</div><div class="line">379</div><div class="line">380</div><div class="line">381</div><div class="line">382</div></pre></td><td class="code"><pre><div class="line">#</div><div class="line"># 对于一些基本指令的添加</div><div class="line">#</div><div class="line">#############################################</div><div class="line"># 代码混淆压缩比，在0~7之间，默认为5，一般不做修改</div><div class="line">-optimizationpasses 5</div><div class="line"> </div><div class="line"># 混合时不使用大小写混合，混合后的类名为小写</div><div class="line">-dontusemixedcaseclassnames</div><div class="line"> </div><div class="line"># 指定不去忽略非公共库的类</div><div class="line">-dontskipnonpubliclibraryclasses</div><div class="line"> </div><div class="line"># 这句话能够使我们的项目混淆后产生映射文件</div><div class="line"># 包含有类名-&gt;混淆后类名的映射关系</div><div class="line">-verbose</div><div class="line"> </div><div class="line"># 指定不去忽略非公共库的类成员</div><div class="line">-dontskipnonpubliclibraryclassmembers</div><div class="line"> </div><div class="line"># 不做预校验，preverify是proguard的四个步骤之一，Android不需要preverify，去掉这一步能够加快混淆速度。</div><div class="line">-dontpreverify</div><div class="line"> </div><div class="line"># 保留Annotation不混淆</div><div class="line">-keepattributes *Annotation*,InnerClasses</div><div class="line"> </div><div class="line"># 避免混淆泛型</div><div class="line">-keepattributes Signature</div><div class="line"> </div><div class="line"># 抛出异常时保留代码行号</div><div class="line">-keepattributes SourceFile,LineNumberTable</div><div class="line"> </div><div class="line"># 指定混淆是采用的算法，后面的参数是一个过滤器</div><div class="line"># 这个过滤器是谷歌推荐的算法，一般不做更改</div><div class="line">-optimizations !code/simplification/cast,!field/*,!class/merging/*</div><div class="line"> </div><div class="line"> </div><div class="line">#############################################</div><div class="line">#</div><div class="line"># Android开发中一些需要保留的公共部分</div><div class="line">#</div><div class="line">#############################################</div><div class="line"> </div><div class="line"># 保留我们使用的四大组件，自定义的Application等等这些类不被混淆</div><div class="line"># 因为这些子类都有可能被外部调用</div><div class="line">-keep public class * extends android.app.Activity</div><div class="line">-keep public class * extends android.app.Appliction</div><div class="line">-keep public class * extends android.app.Service</div><div class="line">-keep public class * extends android.content.BroadcastReceiver</div><div class="line">-keep public class * extends android.content.ContentProvider</div><div class="line">-keep public class * extends android.app.backup.BackupAgentHelper</div><div class="line">-keep public class * extends android.preference.Preference</div><div class="line">-keep public class * extends android.view.View</div><div class="line">-keep public class com.android.vending.licensing.ILicensingService</div><div class="line"> </div><div class="line"> </div><div class="line"># 保留support下的所有类及其内部类</div><div class="line">-keep class android.support.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># 保留继承的</div><div class="line">-keep public class * extends android.support.v4.**</div><div class="line">-keep public class * extends android.support.v7.**</div><div class="line">-keep public class * extends android.support.annotation.**</div><div class="line"> </div><div class="line"># 保留R下面的资源</div><div class="line">-keep class **.R$* &#123;*;&#125;</div><div class="line"> </div><div class="line"># 保留本地native方法不被混淆</div><div class="line">-keepclasseswithmembernames class * &#123;</div><div class="line">    native &lt;methods&gt;;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 保留在Activity中的方法参数是view的方法，</div><div class="line"># 这样以来我们在layout中写的onClick就不会被影响</div><div class="line">-keepclassmembers class * extends android.app.Activity&#123;</div><div class="line">    public void *(android.view.View);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 保留枚举类不被混淆</div><div class="line">-keepclassmembers enum * &#123;</div><div class="line">    public static **[] values();</div><div class="line">    public static ** valueOf(java.lang.String);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 保留我们自定义控件（继承自View）不被混淆</div><div class="line">-keep public class * extends android.view.View&#123;</div><div class="line">    *** get*();</div><div class="line">    void set*(***);</div><div class="line">    public &lt;init&gt;(android.content.Context);</div><div class="line">    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);</div><div class="line">    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 保留Parcelable序列化类不被混淆</div><div class="line">-keep class * implements android.os.Parcelable &#123;</div><div class="line">    public static final android.os.Parcelable$Creator *;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 保留Serializable序列化的类不被混淆</div><div class="line">-keepclassmembers class * implements java.io.Serializable &#123;</div><div class="line">    static final long serialVersionUID;</div><div class="line">    private static final java.io.ObjectStreamField[] serialPersistentFields;</div><div class="line">    !static !transient &lt;fields&gt;;</div><div class="line">    !private &lt;fields&gt;;</div><div class="line">    !private &lt;methods&gt;;</div><div class="line">    private void writeObject(java.io.ObjectOutputStream);</div><div class="line">    private void readObject(java.io.ObjectInputStream);</div><div class="line">    java.lang.Object writeReplace();</div><div class="line">    java.lang.Object readResolve();</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 对于带有回调函数的onXXEvent、**On*Listener的，不能被混淆</div><div class="line">-keepclassmembers class * &#123;</div><div class="line">    void *(**On*Event);</div><div class="line">    void *(**On*Listener);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># webView处理，项目中没有使用到webView忽略即可</div><div class="line">-keepclassmembers class fqcn.of.javascript.interface.for.webview &#123;</div><div class="line">    public *;</div><div class="line">&#125;</div><div class="line">-keepclassmembers class * extends android.webkit.webViewClient &#123;</div><div class="line">    public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);</div><div class="line">    public boolean *(android.webkit.WebView, java.lang.String);</div><div class="line">&#125;</div><div class="line">-keepclassmembers class * extends android.webkit.webViewClient &#123;</div><div class="line">    public void *(android.webkit.webView, jav.lang.String);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 移除Log类打印各个等级日志的代码，打正式包的时候可以做为禁log使用，这里可以作为禁止log打印的功能使用</div><div class="line"># 记得proguard-android.txt中一定不要加-dontoptimize才起作用</div><div class="line"># 另外的一种实现方案是通过BuildConfig.DEBUG的变量来控制</div><div class="line">#-assumenosideeffects class android.util.Log &#123;</div><div class="line">#    public static int v(...);</div><div class="line">#    public static int i(...);</div><div class="line">#    public static int w(...);</div><div class="line">#    public static int d(...);</div><div class="line">#    public static int e(...);</div><div class="line">#&#125;</div><div class="line"> </div><div class="line">#############################################</div><div class="line">#</div><div class="line"># 项目中特殊处理部分</div><div class="line">#</div><div class="line">#############################################</div><div class="line"> </div><div class="line">#-----------处理反射类---------------</div><div class="line"> </div><div class="line"> </div><div class="line"> </div><div class="line">#-----------处理js交互---------------</div><div class="line"> </div><div class="line"> </div><div class="line"> </div><div class="line">#-----------处理实体类---------------</div><div class="line"># 在开发的时候我们可以将所有的实体类放在一个包内，这样我们写一次混淆就行了。</div><div class="line">#-keep public class com.ljd.example.entity.** &#123;</div><div class="line">#    public void set*(***);</div><div class="line">#    public *** get*();</div><div class="line">#    public *** is*();</div><div class="line">#&#125;</div><div class="line"> </div><div class="line"> </div><div class="line">#-----------处理第三方依赖库---------</div><div class="line"># AndroidEventBus</div><div class="line">-keep class org.simple.** &#123; *; &#125;</div><div class="line">-keep interface org.simple.** &#123; *; &#125;</div><div class="line">-keepclassmembers class * &#123;</div><div class="line">    @org.simple.eventbus.Subscriber &lt;methods&gt;;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 百度地图（jar包换成自己的版本，记得签名要匹配）</div><div class="line">-libraryjars libs/baidumapapi_v2_1_3.jar</div><div class="line">-keep class com.baidu.** &#123;*;&#125;</div><div class="line">-keep class vi.com.** &#123;*;&#125;</div><div class="line">-keep class com.sinovoice.** &#123;*;&#125;</div><div class="line">-keep class pvi.com.** &#123;*;&#125;</div><div class="line">-dontwarn com.baidu.**</div><div class="line">-dontwarn vi.com.**</div><div class="line">-dontwarn pvi.com.**</div><div class="line"> </div><div class="line"># Bugly</div><div class="line">-dontwarn com.tencent.bugly.**</div><div class="line">-keep class com.tencent.bugly.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># ButterKnife</div><div class="line">-keep class butterknife.** &#123; *; &#125;</div><div class="line">-dontwarn butterknife.internal.**</div><div class="line">-keep class **$$ViewBinder &#123; *; &#125; </div><div class="line">-keepclasseswithmembernames class * &#123;</div><div class="line">    @butterknife.* &lt;fields&gt;;</div><div class="line">&#125; </div><div class="line">-keepclasseswithmembernames class * &#123;</div><div class="line">    @butterknife.* &lt;methods&gt;;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># EventBus</div><div class="line">-keepattributes *Annotation*</div><div class="line">-keepclassmembers class ** &#123;</div><div class="line">    @org.greenrobot.eventbus.Subscribe &lt;methods&gt;;</div><div class="line">&#125;</div><div class="line">-keep enum org.greenrobot.eventbus.ThreadMode &#123; *; &#125;</div><div class="line"> </div><div class="line"># Facebook</div><div class="line">-keep class com.facebook.** &#123;*;&#125;</div><div class="line">-keep interface com.facebook.** &#123;*;&#125;</div><div class="line">-keep enum com.facebook.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># FastJson</div><div class="line">-dontwarn com.alibaba.fastjson.**</div><div class="line">-keep class com.alibaba.fastjson.** &#123; *; &#125;</div><div class="line">-keepattributes Signature</div><div class="line">-keepattributes *Annotation*</div><div class="line"> </div><div class="line"># Fresco</div><div class="line">-keep class com.facebook.fresco.** &#123;*;&#125;</div><div class="line">-keep interface com.facebook.fresco.** &#123;*;&#125;</div><div class="line">-keep enum com.facebook.fresco.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># 高德相关依赖</div><div class="line"># 集合包:3D地图3.3.2 导航1.8.0 定位2.5.0</div><div class="line">-dontwarn com.amap.api.**</div><div class="line">-dontwarn com.autonavi.**</div><div class="line">-keep class com.amap.api.**&#123;*;&#125;</div><div class="line">-keep class com.autonavi.**&#123;*;&#125;</div><div class="line"># 地图服务</div><div class="line">-dontwarn com.amap.api.services.**</div><div class="line">-keep class com.map.api.services.** &#123;*;&#125;</div><div class="line"># 3D地图</div><div class="line">-dontwarn com.amap.api.mapcore.**</div><div class="line">-dontwarn com.amap.api.maps.**</div><div class="line">-dontwarn com.autonavi.amap.mapcore.**</div><div class="line">-keep class com.amap.api.mapcore.**&#123;*;&#125;</div><div class="line">-keep class com.amap.api.maps.**&#123;*;&#125;</div><div class="line">-keep class com.autonavi.amap.mapcore.**&#123;*;&#125;</div><div class="line"># 定位</div><div class="line">-dontwarn com.amap.api.location.**</div><div class="line">-dontwarn com.aps.**</div><div class="line">-keep class com.amap.api.location.**&#123;*;&#125;</div><div class="line">-keep class com.aps.**&#123;*;&#125;</div><div class="line"># 导航</div><div class="line">-dontwarn com.amap.api.navi.**</div><div class="line">-dontwarn com.autonavi.**</div><div class="line">-keep class com.amap.api.navi.** &#123;*;&#125;</div><div class="line">-keep class com.autonavi.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># Glide</div><div class="line">-keep public class * implements com.bumptech.glide.module.GlideModule</div><div class="line">-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** &#123;</div><div class="line">  **[] $VALUES;</div><div class="line">  public *;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># Gson</div><div class="line">-keepattributes Signature-keepattributes *Annotation*</div><div class="line">-keep class sun.misc.Unsafe &#123; *; &#125;</div><div class="line">-keep class com.google.gson.stream.** &#123; *; &#125;</div><div class="line"># 使用Gson时需要配置Gson的解析对象及变量都不混淆。不然Gson会找不到变量。</div><div class="line"># 将下面替换成自己的实体类</div><div class="line">-keep class com.example.bean.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># Jackson</div><div class="line">-dontwarn org.codehaus.jackson.**</div><div class="line">-dontwarn com.fasterxml.jackson.databind.**</div><div class="line">-keep class org.codehaus.jackson.** &#123; *;&#125;</div><div class="line">-keep class com.fasterxml.jackson.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># 极光推送</div><div class="line">-dontoptimize</div><div class="line">-dontpreverify</div><div class="line">-dontwarn cn.jpush.**</div><div class="line">-keep class cn.jpush.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># OkHttp3</div><div class="line">-dontwarn com.squareup.okhttp3.**</div><div class="line">-keep class com.squareup.okhttp3.** &#123; *;&#125;</div><div class="line">-dontwarn okio.**</div><div class="line"> </div><div class="line"># Okio</div><div class="line">-dontwarn com.squareup.**  </div><div class="line">-dontwarn okio.**  </div><div class="line">-keep public class org.codehaus.* &#123; *; &#125;  </div><div class="line">-keep public class java.nio.* &#123; *; &#125;</div><div class="line"> </div><div class="line"># OrmLite</div><div class="line">-keepattributes *DatabaseField* </div><div class="line">-keepattributes *DatabaseTable* </div><div class="line">-keepattributes *SerializedName*  </div><div class="line">-keep class com.j256.**</div><div class="line">-keepclassmembers class com.j256.** &#123; *; &#125;</div><div class="line">-keep enum com.j256.**</div><div class="line">-keepclassmembers enum com.j256.** &#123; *; &#125;</div><div class="line">-keep interface com.j256.**</div><div class="line">-keepclassmembers interface com.j256.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># Realm</div><div class="line">-keep class io.realm.annotations.RealmModule</div><div class="line">-keep @io.realm.annotations.RealmModule class *</div><div class="line">-keep class io.realm.internal.Keep</div><div class="line">-keep @io.realm.internal.Keep class * &#123; *; &#125;</div><div class="line">-dontwarn javax.**</div><div class="line">-dontwarn io.realm.**</div><div class="line"> </div><div class="line"># Retrofit</div><div class="line">-dontwarn retrofit2.**</div><div class="line">-keep class retrofit2.** &#123; *; &#125;</div><div class="line">-keepattributes Signature</div><div class="line">-keepattributes Exceptions</div><div class="line"> </div><div class="line"># Retrolambda</div><div class="line">-dontwarn java.lang.invoke.*</div><div class="line"> </div><div class="line"># RxJava RxAndroid</div><div class="line">-dontwarn sun.misc.**</div><div class="line">-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* &#123;</div><div class="line">    long producerIndex;</div><div class="line">    long consumerIndex;</div><div class="line">&#125;</div><div class="line">-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef &#123;</div><div class="line">    rx.internal.util.atomic.LinkedQueueNode producerNode;</div><div class="line">&#125;</div><div class="line">-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef &#123;</div><div class="line">    rx.internal.util.atomic.LinkedQueueNode consumerNode;</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 微信支付</div><div class="line">-dontwarn com.tencent.mm.**</div><div class="line">-dontwarn com.tencent.wxop.stat.**</div><div class="line">-keep class com.tencent.mm.** &#123;*;&#125;</div><div class="line">-keep class com.tencent.wxop.stat.**&#123;*;&#125;</div><div class="line"> </div><div class="line"># 信鸽</div><div class="line">-keep public class * extends android.app.Service</div><div class="line">-keep public class * extends android.content.BroadcastReceiver</div><div class="line">-keep class com.tencent.android.tpush.**  &#123;* ;&#125;</div><div class="line">-keep class com.tencent.mid.**  &#123;* ;&#125;</div><div class="line">-keepattributes *Annotation*</div><div class="line"> </div><div class="line"># 新浪微博</div><div class="line">-keep class com.sina.weibo.sdk.* &#123; *; &#125;  </div><div class="line">-keep class android.support.v4.* &#123; *; &#125;  </div><div class="line">-keep class com.tencent.* &#123; *; &#125;  </div><div class="line">-keep class com.baidu.* &#123; *; &#125;  </div><div class="line">-keep class lombok.ast.ecj.* &#123; *; &#125;  </div><div class="line">-dontwarn android.support.v4.**  </div><div class="line">-dontwarn com.tencent.**s  </div><div class="line">-dontwarn com.baidu.**  </div><div class="line"> </div><div class="line"># 讯飞语音</div><div class="line">-dontwarn com.iflytek.**</div><div class="line">-keep class com.iflytek.** &#123;*;&#125;</div><div class="line"> </div><div class="line"># 银联</div><div class="line">-dontwarn com.unionpay.**</div><div class="line">-keep class com.unionpay.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># 友盟统计分析</div><div class="line">-keepclassmembers class * &#123; public &lt;init&gt;(org.json.JSONObject); &#125;</div><div class="line">-keepclassmembers enum com.umeng.analytics.** &#123;</div><div class="line">    public static **[] values();</div><div class="line">    public static ** valueOf(java.lang.String);</div><div class="line">&#125;</div><div class="line"> </div><div class="line"># 友盟自动更新</div><div class="line">-keepclassmembers class * &#123; public &lt;init&gt;(org.json.JSONObject); &#125;</div><div class="line">-keep public class cn.irains.parking.cloud.pub.R$*&#123; public static final int *; &#125;</div><div class="line">-keep public class * extends com.umeng.**</div><div class="line">-keep class com.umeng.** &#123; *; &#125;</div><div class="line"> </div><div class="line"># 支付宝钱包</div><div class="line">-dontwarn com.alipay.**</div><div class="line">-dontwarn HttpUtils.HttpFetcher</div><div class="line">-dontwarn com.ta.utdid2.**</div><div class="line">-dontwarn com.ut.device.**</div><div class="line">-keep class com.alipay.android.app.IAlixPay&#123;*;&#125;</div><div class="line">-keep class com.alipay.android.app.IAlixPay$Stub&#123;*;&#125;</div><div class="line">-keep class com.alipay.android.app.IRemoteServiceCallback&#123;*;&#125;</div><div class="line">-keep class com.alipay.android.app.IRemoteServiceCallback$Stub&#123;*;&#125;</div><div class="line">-keep class com.alipay.sdk.app.PayTask&#123; public *;&#125;</div><div class="line">-keep class com.alipay.sdk.app.AuthTask&#123; public *;&#125;</div><div class="line">-keep class com.alipay.mobilesecuritysdk.*</div><div class="line">-keep class com.ut.*</div></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2017/01/24/Android Studio混淆模板及常用第三方混淆/" data-id="ciyb6zm860000u9f2xdpp0n85" class="article-share-link">分享</a>
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/android-混淆-proguard/">android 混淆 proguard</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/01/23/hello-world/" class="article-date">
  <time datetime="2017-01-23T02:17:07.000Z" itemprop="datePublished">2017-01-23</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/01/23/hello-world/">Hello World</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <!-- Table of Contents -->
        
        <p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="external">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="external">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo new <span class="string">"My New Post"</span></div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo server</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="external">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo generate</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="external">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo deploy</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="external">Deployment</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2017/01/23/hello-world/" data-id="ciyb6zm8j0001u9f2778vojh7" class="article-share-link">分享</a>
      
      
      
    </footer>
  </div>
  
</article>



  
    <article id="post-测试" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/01/23/测试/" class="article-date">
  <time datetime="2017-01-22T16:00:00.000Z" itemprop="datePublished">2017-01-23</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/测试/">测试</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/01/23/测试/">测试标题</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <!-- Table of Contents -->
        
        <figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> [] args)</span></span>&#123;</div><div class="line">    System.out.println(<span class="string">"Hello world"</span>);</div><div class="line">&#125;</div></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2017/01/23/测试/" data-id="ciyb6zm910004u9f2nda7ksfo" class="article-share-link">分享</a>
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/测试/">测试</a></li></ul>

    </footer>
  </div>
  
</article>



  

</section>
           
    <aside id="sidebar">
  
    
  <div class="widget-wrap">
     
        <h3 class="follow-title ">Follow me</h3>
     
    <div class="widget follow">
     
     
            <a class="github" aria-hidden="true" href="https://github.com/giscafer" target="_blank" title="Github"></a>
    
     
          <a class="weibo" aria-hidden="true"  href="http://weibo.com/laohoubin" target="_blank" title="微博"></a>
    
     
            <a class="zhihu" aria-hidden="true"  href="http://www.zhihu.com/people/giscafer" target="_blank" title="知乎"></a>
    
     
          <a class="email" aria-hidden="true"  href="mailto:youemail@outlook.com" target="_blank" title="邮箱"></a>
    
    </div>
  </div>


  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title categories">分类</h3>
    <div class="widget" id="categories">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Android-Studio混淆模板及常用第三方混淆/">Android Studio混淆模板及常用第三方混淆</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/测试/">测试</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title tagcloud">标签云</h3>
    <div class="widget tagcloud">
      <a href="/tags/android-混淆-proguard/" style="font-size: 10px;">android 混淆 proguard</a> <a href="/tags/测试/" style="font-size: 10px;">测试</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title recent-posts">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2017/01/24/Android Studio混淆模板及常用第三方混淆/">Android Studio混淆模板及常用第三方混淆</a>
          </li>
        
          <li>
            <a href="/2017/01/23/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2017/01/23/测试/">测试标题</a>
          </li>
        
      </ul>
    </div>
  </div>

  
    

   <div class="widget-wrap">
    <h3 class="widget-title lastest-comments">最新评论</h3>
    <div class="widget">
        <span>此widget基于多说，如需使用，请启用 duoshuo_shortname 属性</span>
    </div>
  </div>


  
    

   <div class="widget-wrap">
    <h3 class="widget-title hot-comment-posts">热评文章</h3>
    <div class="widget">
        <span>此widget基于多说，如需使用，请启用 duoshuo_shortname 属性</span>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title archive">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/">一月 2017</a><span class="archive-list-count">3</span></li></ul>
    </div>
  </div>


  
</aside>

      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-left">
      &copy; 2014 - 2017 icoo&nbsp;|&nbsp;
      主题 <a href="https://github.com/giscafer/hexo-theme-cafe/" target="_blank">Cafe</a>
    </div>
     <div id="footer-right">
      联系方式&nbsp;|&nbsp;youemail@outlook.com
    </div>
  </div>
</footer>
 <script src="/jquery/jquery.min.js"></script>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">归档</a>
  
    <a href="/about" class="mobile-nav-link">关于</a>
  
</nav>
    <img class="back-to-top-btn" src="/images/fly-to-top.png"/>
<script>
// Elevator script included on the page, already.
window.onload = function() {
  var elevator = new Elevator({
    selector:'.back-to-top-btn',
    element: document.querySelector('.back-to-top-btn'),
    duration: 1000 // milliseconds
  });
}
</script>
    



 <script src="/js/is.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>
<script src="/js/elevator.js"></script>
  </div>
</body>
</html>